package net.neptech.api;

import net.neptech.dto.sys.StaffDTO;
import net.neptech.dto.workflow.UserQueryDto;
import net.neptech.model.sys.Dept;
import net.neptech.model.sys.Role;
import net.neptech.vm.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "system", path = "system")
public interface SystemApi {
    @GetMapping("staff/getStaff")
    ResponseResult<List<StaffDTO>> getStaff();

    @GetMapping("staff/getStaff/{userId}")
    ResponseResult<StaffDTO> getStaffByUserId(@PathVariable("userId") String userId);

    @GetMapping("staff/getRoleIds/{userId}")
    ResponseResult<List<String>> getRoleIdsByUserId(@PathVariable("userId") String userId);

    @PostMapping("staff/getUserIdsByDto")
    ResponseResult<List<String>> getUserIdsByDto(@RequestBody UserQueryDto userQueryDto);

    @GetMapping("staff/getByDept/{deptId}")
    ResponseResult<List<StaffDTO>> getUserByDept(@PathVariable("deptId") String deptId);

    @GetMapping("staff/search/{keyword}")
    ResponseResult<List<StaffDTO>> searchStaff(@PathVariable("keyword") String userName);

    @GetMapping("dept/getDepts")
    ResponseResult<List<Dept>> getDeptByDeptIds(@RequestParam("deptIds") List<String> deptIds);

    @GetMapping("dept/getAll")
    ResponseResult<List<Dept>> getAllDept();

    @GetMapping("role/getAll")
    ResponseResult<List<Role>> getAllRole();

}
